/**
 * 
 */
package STUDENTS.TRANTHAIHA.DEMO;

import java.util.Scanner;

/**
 * @author Administrator
 *
 */
public class kilogam {

	public static void main(String[] args) {
		String strExit = "";
		Scanner sc = new Scanner(System.in);

		String strTemp = "";
		do {

			do {
				System.out.println("moi nhap thang");
				strTemp = sc.nextLine();
			} while (strTemp.isEmpty() || Integer.parseInt(strTemp) < 1 || Integer.parseInt(strTemp) > 12);

			byte bMonth = Byte.parseByte(strTemp);
			do {
				System.out.println("moi nhap nam");
				strTemp = sc.nextLine();
			} while (strTemp.isEmpty());
			int nYear = Integer.parseInt(strTemp);

			switch (bMonth) {
			case 4:
			case 6:
			case 9:
			case 11:
				System.out.println("co 30 ngay");
				break;
			case 2:
				if (nYear % 400 == 0 || nYear % 4 == 0 && nYear % 100 != 0) {
					System.out.println("co 29 ngay");
				} else
					System.out.println("co 28 ngay");

			default:
				System.out.println("co 31 ngay");
				break;
			}
			System.out.println("ban da chan chua");
			strExit = sc.nextLine();
		} while (!strExit.toUpperCase().equals("Y"));

	}
}